document.addEventListener("DOMContentLoaded",function(){const t=document.getElementsByClassName("storefront-sticky-add-to-cart");if(t.length&&"undefined"!=typeof storefront_sticky_add_to_cart_params){const n=document.getElementsByClassName(storefront_sticky_add_to_cart_params.trigger_class);if(0<n.length){const o=function(){n[0].getBoundingClientRect().top+n[0].scrollHeight<0?(t[0].classList.add("storefront-sticky-add-to-cart--slideInDown"),t[0].classList.remove("storefront-sticky-add-to-cart--slideOutUp")):t[0].classList.contains("storefront-sticky-add-to-cart--slideInDown")&&(t[0].classList.add("storefront-sticky-add-to-cart--slideOutUp"),t[0].classList.remove("storefront-sticky-add-to-cart--slideInDown"))};o(),window.addEventListener("scroll",function(){o()});let e=null;var s;document.body.classList.forEach(function(t){"postid-"===t.substring(0,7)&&(e=t.replace(/[^0-9]/g,""))}),!e||!(s=document.getElementById("product-"+e))||s.classList.contains("product-type-simple")||s.classList.contains("product-type-external")||document.getElementsByClassName("storefront-sticky-add-to-cart__content-button")[0].addEventListener("click",function(t){t.preventDefault(),document.getElementById("product-"+e).scrollIntoView()})}}});
